Load the symbol list and get the historical data, load to enviroment e
data("sp500Symbols") ## build new data e<-new.env() failList <- getHistoricalStocks(sp500Symbols, e) stockDataEnv<-e save(stockDataEnv, file = 'stockDataEnv.rda')
Load pre downloaded data from and enviroment, saved as an rda file set the dependent and class variables. This uses the buildStockdatasetfromEnv function to take all stocks in the enviroment, and turn them into a data data frame suitable for modeling
load('stockDataEnv.rda') rd<-na.buildStockDataSetFromEnv(stockDataEnv) ## get Varible Names classCol<- "tradeFlag" predVars<-colnames(rd)[!colnames(rd) %in% c( "time","tradeInd","stockName",classCol)] dim(rd)
Load a pre trained cluster model for the data and use cluster prediction as features for the rd data frame
load('clusterFit.rda') ## loads as cluster fit rd.clean<-na.omit(rd) km.df<-predictKmeans(clusterFit, rd.clean)
```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.